import type { ResponseData } from '@/utils/types.d';
import { SUCCESS_CODE } from '@/utils/types.d';
import request from '@/utils/request';
import type { LotDailyStatisticType } from './types.d';

export async function getDailyStatistic(lotId: string): Promise<{
  success: boolean;
  message: string;
  data: LotDailyStatisticType;
}> {
  const res: ResponseData<LotDailyStatisticType> = await request(
    `/api/statistics/v1.0.0/daily/${lotId}`,
  );
  if (res?.code === SUCCESS_CODE) return { success: true, message: '获取成功', data: res.data };
  return { success: false, message: res?.message || '获取失败', data: res?.data };
}
